<?php

    // Include the UberGallery class
    include('resources/UberGallery.php');

    // Initialize the UberGallery object
    $gallery = new UberGallery();

    // Initialize the gallery array
    // 自定义图像源的真实路径,初始化画廊数组
    $galleryArray = $gallery->readImageDirectory('gallery-images'); 
    
    //查看画廊数组
    //var_dump($galleryArray); die;
    
    // Define theme path
    if (!defined('THEMEPATH')) {
        define('THEMEPATH', $gallery->getThemePath());
    }
    //查看主题"resources/themes/uber-blue"
    //var_dump($gallery->getThemePath()); die;
    
    // Set path to theme index
    $themeIndex = $gallery->getThemePath(true) . '/index.php';
    
    //var_dump($themeIndex); die;
    
    // Initialize the theme
    if (file_exists($themeIndex)) {
      
        //加载指定模板文件,循环数组创建标签
        include($themeIndex); 
    } else {
        die('ERROR: Failed to initialize theme');
    }
